package com.yjy.exception;

public class TradeException extends RuntimeException {

    private static final long serialVersionUID = 2940508928394316476L;
    private String code;
    private String msg;

    public TradeException() {
        super(PaymentTradeMsgCode.SYSTEM_ERROR.getMsg());
        new TradeException(PaymentTradeMsgCode.SYSTEM_ERROR);
    }

    public TradeException(Throwable throwable) {
        super(throwable);
        this.msg = throwable.getMessage();
    }

    public TradeException(String code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public TradeException(Throwable throwable, String code, String msg) {
        super(throwable);
        this.code = code;
        this.msg = msg;
    }

    public TradeException(String msg, Throwable throwable) {
        super(msg, throwable);
    }

    public TradeException(MsgCode msgCode) {
        super(msgCode.getMsg());
        this.code = msgCode.getCode();
        this.msg = msgCode.getMsg();
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}